#include "CRole.h"

CRole::CRole() :
m_Level(0),
m_isPlayer(false),
m_Dir(1)
{
	m_pAction = new CAction();
	memset(&m_CrashRect, 0, sizeof(RECT));
}

CRole::~CRole()
{
	SAFE_DELETE(m_pAction)
}

void CRole::Render(CBufferDC * pBufferDC)
{
	UINT nAction = m_pAction->GetAction();
	pBufferDC->TransparentBlt(m_Pos.x,  m_Pos.y, m_Size.cx, m_Size.cy, m_hDCs[nAction], 
		0, 0, m_SrcSize.cx, m_SrcSize.cy, RGB(0,0,0));
}

int CRole::GetDir()
{
	return m_Dir;
}

void CRole::SetDir(int i)
{
	m_Dir = i;
}

int CRole::GetLevel()
{
	return m_Level;
}

RECT CRole::GetCrashRect()
{
	RECT rect;

	rect.left = m_CrashRect.left + m_Pos.x;
	rect.right = m_CrashRect.right + m_Pos.x;
	rect.top = m_CrashRect.top + m_Pos.y;
	rect.bottom = m_CrashRect.bottom + m_Pos.y;

	return rect;
}